<template>
  <transition name="fade">
    <div class="modal-container" v-on:click.prevent.stop="closeToast" v-if="isShow">
      <div class="wrapper">
        <div><img :src="showModalMask" alt=""></div>
        <div class="close" @click="closeToast">&times;</div>
      </div>
    </div>
  </transition>
</template>
<script>
export default {
  props:['data'],
  data() {
    return {
      isShow: false,
      modalPic: [
        require("../../assets/img/yxWeeks/week12.png")
      ],
      showModalMask: null
    };
  },
  created() {
    this.showMask();
  },
  methods: {
    closeToast() {
      this.isShow = false;
      this.$emit("closeModal");
    },
    showMask() {
      if(this.data.modalType==1){this.showModalMask=this.modalPic[0];}
      this.isShow = true;
    }
  }
}
</script>
<style lang='less' scoped>
.modal-container {
  width: 100%;height: 100%;
  position: fixed;
  left: 0;right: 0;
  top: 0rem;
  background: rgba(0,0,0,0.4);
  z-index: 10;
  .wrapper{
    margin-top: 1.5rem;
    position: relative;
    .close{
      width: 0.3rem;
      height: 0.3rem;
      line-height: 0.3rem;
      color: #fff;
      font-size: 0.4rem;
      position: absolute;
      top: 1.25rem;right: 2rem;
    }
  }
}
.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.8s;
}
.fade-enter,
.fade-leave-active {
  opacity: 0;
}
</style>